home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Tech Arsenal 1
/
Tech Arsenal (Arsenal Computer).ISO
/
tek-02
/
prodpack.zip
/
DB4PPSRC.EXE
/
_CATCODE.PRG
< prev
next >
Wrap
Text File
|
1993-05-04
|
2KB
|
59 lines
PROCEDURE _CatCode
PARAMETERS pc_file, pn_code
*---------------------------------------------------------------------
* NAME
* _CatCode - get the CODE for a specified file in the catalog
*
* DESCRIPTION
* _CatCode will put the CODE field value into <pn_code> for the catalog
* FILE_NAME specified by pc_file. If pc_file was not located
* in the catalog, _CatCode return a blank value for <pn_code>.
*
* _CatCode will keep the record pointer in the Catalog at
* the FILE_NAME record.
*
* SYNOPSIS
* DO _CatCode WITH <pc_file>, <pn_code>
*
* PARAMETERS
* pc_file = file name to search with
* pn_code = return code for file, 0 if no match.
*
* EXAMPLE
* *-- Find the CODE for file GOODS.SCR
* ll_CatOpen
* DO _CatOpen WITH ll_CatOpen
* IF ll_CatOpen
* SELECT FXCatalog
* ln_code = 0
* DO _CatCode WITH "GOODS.SCR", ln_code
* DO _CatClose
* ENDIF
*
* LIMITATIONS
* pc_file is fileroot() + '.' + filetype() format
*
* DEPENDENCIES
* The catalog must be in the current work area
*
* VARIABLES
* lc_file = Uppercase representation of <pc_file> value
*
*---------------------------------------------------------------------
PRIVATE lc_file
pn_code = -1 && Assume the worst case for result
*-- Look for the file selected in the open catalog file
lc_file = UPPER( pc_file ) && Force the search to upper case
LOCATE FOR UPPER( file_name ) = lc_file
IF FOUND() && If the file was found
pn_code = FXCatalog->code && Pull in the code for the result
ENDIF
RETURN
*-- EOP: _CatCode WITH pc_file, pn_code